* {
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
}
.layout {
  width: 100%;
  height: 100%;
  min-width: 320px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
}
.layout header {
  position: relative;
}
.layout header .bg {
  width: 100%;
  display: block;
}
.layout header .hui {
  width: 1rem;
  height: 1rem;
  position: absolute;
  top: 0.1rem;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
}
.layout header div {
  position: absolute;
  bottom: 0;
  height: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}
.layout header div img {
  display: block;
  position: absolute;
  left: 50%;
  top: 0.39rem;
}
.layout header div .search {
  width: 0.9rem;
  height: 0.31rem;
  transform: translate(-110%, -50%);
}
.layout header div .message {
  width: 0.9rem;
  height: 0.31rem;
  transform: translate(10%, -50%);
}
.layout nav ul {
  background-color: #ccc;
  overflow: hidden;
}
.layout nav ul li {
  float: left;
  width: 50%;
  height: 0.55rem;
  font-size: 0.2rem;
  text-align: center;
  line-height: 0.55rem;
}
.layout nav ul li.active {
  border-bottom: 1px  solid  red;
}
.layout nav ul .left {
  border-right: 1px  solid  #fff;
}
.layout main {
  flex: 1;
  overflow: auto;
}
.layout main ul {
  overflow: hidden;
  padding: 0.05rem;
}
.layout main ul li {
  padding: 0.05rem;
  float: left;
  width: 33%;
  border: 1px  solid red;
  margin-bottom: 0.1rem;
}
.layout main ul li:nth-child(3n-1) {
  margin: 0  0.5%;
}
.layout main ul li a {
  display: block;
  width: 100%;
}
.layout main ul li a img {
  width: 100%;
  display: block;
}
.layout main ul li a h6 {
  font-size: 0.2rem;
  text-align: center;
}
.layout main ul li a p {
  font-size: 0.18rem;
}
.layout main ul li a div {
  font-size: 0.18rem;
  height: 0.3rem;
  width: 70%;
  margin: 0  auto;
  background-color: red;
  color: #fff;
  text-align: center;
  line-height: 0.3rem;
  padding: 0  0.2rem;
  border-radius: 0.1rem;
}
